From: Jo-Philipp Wich Date: Tue, 25 Oct 2022 10:50:37 +0000 (+0200) Subject: luci-base: dispatcher.uc: reintroduce support for 'absent' fs depends X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=adc4ca65bccfa6265bdd5e1ae70aabae09bd617b;p=project%2Fluci.git luci-base: dispatcher.uc: reintroduce support for 'absent' fs depends The ability to require certain paths to be absent for a menu entry to show up was lost during the ucode conversion. Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/ucode/dispatcher.uc b/modules/luci-base/ucode/dispatcher.uc index 7ff8d49c12..50c1a7d0f2 100644 --- a/modules/luci-base/ucode/dispatcher.uc +++ b/modules/luci-base/ucode/dispatcher.uc @@ -183,6 +183,10 @@ function check_fs_depends(spec) { if (fstat?.type != 'file') return false; } + else if (kind == 'absent') { + if (stat(path) != null) + return false; + } } return true;